<!-- 一级账号 -->
<template lang="html">
  <div class="userManagementStair">
    <Card :bordered="false">
      <p slot="title">
        <Row>
          <Col span="4">一级账号</Col>
          <Col span="4" offset="16">
            <Button type="info" style="float: right;">添加</Button>
          </Col>
        </Row>
      </p>
      <p class="searchInput">
        <Row type="flex" justify="end" style="padding:10px 0">
         <Col span="6">
           <Input v-model="searchValue" search enter-button="搜索" placeholder="请输入关键字"></Input>
          </Col>
        </Row>
        <Table border :loading="loading" :columns="columns" :data="listDatas"></Table>
        <!-- <Page :total="100" show-total /> -->
      </p>
    </Card>
  </div>
</template>

<script>
export default {
  name: 'userManagementStair',
  data() {
    return {
      searchValue: null,
      loading: true,
      columns: [
        { title: '建设单位', key: 'monad', align: 'center' },
        { title: '法人', key: 'person', align: 'center' },
        { title: '联系人', key: 'contacts', align: 'center' },
        { title: '联系电话', key: 'Mobile', align: 'center' },
        { title: '权限控制', key: 'jurisdiction', align: 'center' },
        { title: '二级账号数量', key: 'number', align: 'center' },
        { title: '使用年限', key: 'ageLimit', align: 'center' },
        { title: '操作', align: 'center', render: (h, params) => {
          return h("div", [
            h(
              "Button",
              {
                props: {
                  type: "primary",
                  size: "small"
                },
                style: {
                  marginRight: "5px",
                  color: "#ffffff",
                  background: "#2996ff",
                  border: "none",
                  padding: "0px 5px"
                },
                on: {
                  click: () => {
                    this.clickShow(params.index);
                  }
                }
              },
              "查看"
            ),
            h(
              "Button",
              {
                props: {
                  type: "primary",
                  size: "small"
                },
                style: {
                  marginRight: "5px",
                  color: "#ffffff",
                  background: "#19be6b",
                  border: "none",
                  padding: "0px 5px"
                },
                on: {
                  click: () => {
                    this.clickChange(params.index);
                  }
                }
              },
              "修改"
            )
          ])
        }},
      ],
      listDatas: [],
      pages: [],
    }
  },
  mounted() {
    this.getListData(1)
  },
  methods: {
    clickShow(index) {
      console.log(index);
    },
    clickChange(index) {
      console.log('修改');
    },
    getListData(page) {
      axios.get('/accountNumber/findLevelAccount').then((res) => {
        this.listDatas = res.member
        // this.pages = res.pages
        this.loading = false
      })
    }
  },
}
</script>

<style lang="css">
.ivu-card-head p {
  overflow: visible;
}
</style>
